package com.ashapo.example;

public class Example016InitBlock {

    /**
     * 测试初始化程序块的执行顺序
     * @param args
     */
    public static void main(String[] args) {
        B3.run();
    }
}

 class AA {
    AA() {
        System.out.println("parent class constructor invoked");
    }
}

class B3 extends AA {
    B3() {
        super();
        System.out.println("child class constructor invoked");
    }

    B3(int a) {
        super();
        System.out.println("child class constructor invoked " + a);
    }

    {
        System.out.println("instance initializer block is invoked");
    }

    public static void run() {
        B3 b1 = new B3();
        B3 b2 = new B3(10);
    }
}
